@extends('backstage.layout.master')
@section('title', '认证列表')
@section('style')
        <!-- page specific plugin styles -->
<meta name="_token" content="{{csrf_token()}}"/>
<link rel="stylesheet" href="/assets/css/jquery-ui-1.10.3.custom.min.css"/>
<link rel="stylesheet" href="/assets/css/chosen.css"/>
<link rel="stylesheet" href="/assets/css/datepicker.css"/>
<link rel="stylesheet" href="/assets/css/bootstrap-timepicker.css"/>
<link rel="stylesheet" href="/assets/css/daterangepicker.css"/>
<link rel="stylesheet" href="/assets/css/colorpicker.css"/>
<!-- fonts -->
<style>
	#outExcel{
		top:40px;
	}
	.state li{
		list-style:none;
		float:left;
		padding:0 20px;
		text-align:center;
		height:40px;
		line-height:40px;
	}
	.state li a:hover{color:#4D4DB3}
	.state li a{
		color:#668B8B;
		text-decoration:none;
		outline:none;
		blr:expression(this.onFocus=this.blur());
	}
	.curBg{
		background:#4D4DB3;
		height:3px;
		position:absolute;
		width:68px;
		left:35px;
	}
	.state{
		width:px;
		margin:0 auto;
		posiition:relative;
	}
	.cls{clear:both;}
	.state .cur a{
		color:#4D4DB3;
	}
</style>
@stop
@section('script')
	<script src="backstage/assets/js/date-time/bootstrap-datepicker.min.js"></script>
    <script src="backstage/assets/js/date-time/bootstrap-timepicker.min.js"></script>
    <script src="backstage/assets/js/date-time/moment.min.js"></script>
    <script src="backstage/assets/js/date-time/daterangepicker.min.js"></script>
    <script type="text/javascript">
        $(function(){
			$(document).ready(function(){
				var $liCur = $(".state ul li.cur"),
				  curP = $liCur.position().left,
				  curW = $liCur.outerWidth(true),
				  $slider = $(".curBg"),
				  $navBox = $(".state");
				 $targetEle = $(".state ul li a"),
				$slider.animate({
				  "left":curP,
				  "width":curW
				});
				$targetEle.mouseenter(function () {
				  var $_parent = $(this).parent(),
					_width = $_parent.outerWidth(true),
					posL = $_parent.position().left;
				  $slider.stop(true, true).animate({
					"left":posL,
					"width":_width
				  }, "fast");
				});
				$navBox.mouseleave(function (cur, wid) {
				  cur = curP;
				  wid = curW;
				  $slider.stop(true, true).animate({
					"left":cur,
					"width":wid
				  }, "fast");
				});
			});
        });
		$('input[name=date-range-picker]').daterangepicker().prev().on(ace.click_event, function(){
                $(this).next().focus();
         });
		function findOrderBy(){
			var column	= $("#column option:selected").val();
			var value	= $("#"+column).val();
			var str		= "";
			if(value != "" && value != undefined){
				str	   += column+"="+value;
			}

			var column1 = $("#column1 option:selected").val();
			var value1  = $("#"+column1).val();
			if(value1 != "" && value1 != undefined && str.length>0){
				str	   += "&"+column1+"="+value1;
			}else if(value1 != "" && value1 != undefined && str.length==0){
				str    += column1+"="+value1;
			}
			
			var column2 = $("#column2 option:selected").val();
			var value2  = $("#"+column2+" option:selected").val();
			if(value2 != "" && value2 != undefined && str.length>0){
				str	   += "&"+column2+"="+value2;
			}else if(value2 != "" && value2 != undefined && str.length==0){
				str    += column2+"="+value2;
			}
            /*
			var column3 = "pay_type";
			var value3  = $("#pay option:selected").val();
			if(value3 != "" && value3 != undefined && str.length>0){
				str	   += "&"+column3+"="+value3;
			}else if(value3 != "" && value3 != undefined && str.length==0){
				str    += column3+"="+value3;
			}

			var column4 = $("#column4 option:selected").val();
			var value4  = $("#"+column4+" option:selected").val();
			if(value4 != "" && value4 != undefined && str.length>0){
				str	   += "&"+column4+"="+value4;
			}else if(value4 != "" && value4 != undefined && str.length==0){
				str    += column4+"="+value4;
			}
			*/
			//alert(str);
			window.location.href="/backstage/income/apply-withdraw-list?"+str;
		}
		
    </script>
@stop
@section('content')
    <div class="breadcrumbs" id="breadcrumbs">
        <script type="text/javascript">
            try {
                ace.settings.check('breadcrumbs', 'fixed')
            } catch (e) {
            }
        </script>

        <ul class="breadcrumb">
            <li>
                <i class="icon-home home-icon"></i>
                <a href="backstage/home">主页</a>
            </li>

            <li class="active">
                <a href="/backstage/income/apply-withdraw-lis">申请提现列表</a>
            </li><!-- 
            <li>
                申请提现列表
            </li> -->
        </ul><!-- .breadcrumb -->
    </div>

    <div class="page-content">
        <div class="page-header">
            <h1>
                用户
                <small>
                    <i class="icon-double-angle-right"></i>
                    申请提现列表
                </small>
            </h1>
			<!-- <div class="nav-search" id="nav-search">
			
				<button id="outExcel" class="btn" onclick="createExcel();" data="{{isset($_SERVER['QUERY_STRING'])?$_SERVER['QUERY_STRING']:''}}">
					导出订单
				</button>
				<a href="" id="downExcel" style="display:none;" download="">
					下载
				</a>
					
			</div> --><!-- #nav-search -->
        </div>
        <div class="row">
			<div class="nav-search col-xs-12" style="position: static;height: 50px;" id="nav-search">

				<select id="column" style="width:100px;">
					<option value ="phone">手机号</option>
				</select>
				<span class="input-icon" style="width: 209px;">
					<input type="text" class="form-control" id="phone" autocomplete="off" 
					value="{{isset($_GET['phone'])&&$_GET['phone']!=''?$_GET['phone']:''}}"/>
				</span>
						
			</div><!-- #nav-search -->
            <div class="nav-search col-xs-12" style="position: static;height: 50px;" id="nav-search">

                <select id="column1" style="width:100px;">
                    <option value ="card_holder">持卡人姓名</option>
                </select>
                <span class="input-icon" style="width: 209px;">
                    <input type="text" class="form-control" id="card_holder" autocomplete="off" 
                    value="{{isset($_GET['card_holder'])&&$_GET['card_holder']!=''?$_GET['card_holder']:''}}"/>
                </span>
                        
            </div><!-- #nav-search -->
			<div class="nav-search col-xs-12" style="position: static;height: 50px;" id="nav-search">
				<select id="column2" style="width:100px;">
					<option value ="state">状态</option>
				</select>
				<span class="input-icon">
					<select id="state"  style="width:209px;">
						<option value =""></option>
						<option value ="1" @if(isset($_GET['state'])&&$_GET['state']==1) selected="selected" @endif >处理中</option>
						<option value ="2" @if(isset($_GET['state'])&&$_GET['state']==2) selected="selected" @endif >处理完成</option>
					</select>
				</span>
				<button class="btn" onclick="findOrderBy();" >
					搜索
				</button>
			</div><!-- #nav-search -->

            <div class="col-xs-12">
                <!-- PAGE CONTENT BEGINS -->
				
                <div class="table-responsive">
                    <table id="sample-table-1" class="table table-striped table-bordered table-hover">
                        <thead>
                        <tr>
							<th>提现编号</th>
                            <th>用户编号</th>
                            <th>真实姓名</th>
                            <th>手机</th>
							<th>提现金额</th>
							<th>状态</th>
							<th>申请时间</th>
                            <th>操作</th>
                        </tr>
                        </thead>

                        <tbody>
						@if(!isset($result)||count($result)==0)
						<tr class="">
							<td colspan="8">暂时没有可处理数据</td>
						</tr>	
						@else
                        @foreach($result as $re)
                        <tr class="">
							<td>{{isset($re->withdraw_number)?$re->withdraw_number:''}}</td>
                            <td>{{isset($re->user_id)?$re->user_id:''}}</td>
                            <td>{{isset($re->card_holder)?$re->card_holder:''}}</td>
							<td>{{isset($re->phone)?$re->phone:''}}</td>
							<td>{{isset($re->total_fee)?$re->total_fee:''}}</td>
                            <td>
								@if(isset($re->state)&&$re->state==1)
								处理中
								@elseif(isset($re->state)&&$re->state==2)
								处理完成
								@else
								未知状态
								@endif
							</td>
							<td>
								{{isset($re->created_at)?date('Y-m-d H:i:s',$re->created_at):''}}
							</td>
							
                            <td>
								<ul class="nav-pills" style="list-style-type:none">
									<li class="dropdown all-camera-dropdown">
										<a class="dropdown-toggle" data-toggle="dropdown" href="#">
											<span id="app_users_selections_operation_1">操作</span>
				                            <b class="caret"></b>
										</a>
										<ul class="dropdown-menu">
								            <li data-filter-camera-type="all">
						                        <a target="_blank" href="/backstage/income/user-apply-withdraw?withdraw_id={{$re->withdraw_id}}">
				                                    <span id="app_users_selections_contacts_1">申请详情</span>
                                                </a>
                                            </li>
                                        </ul>
						            </li>
								</ul>
                            </td>
                        </tr>
                        @endforeach
						@endif
                        </tbody>
                    </table>
                </div>
				@if(!isset($result))
				@else
                <div class="row">
                    <div class="col-sm-6">
                        <div class="dataTables_info" id="sample-table-2_info"></div>
                    </div>
                    <div class="col-sm-6">
                        <div class="dataTables_paginate paging_bootstrap">
                            <?php echo $result->render(); ?>
                        </div>
                    </div>
                </div>
				@endif
                <!-- PAGE CONTENT ENDS -->
            </div><!-- /.col -->
        </div><!-- /.row -->
    </div><!-- /.page-content -->
@stop
